import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import Index from '@/components/Index'
import News from '@/components/News'
import car from '@/components/Tool'
import Computer from '@/views/Computer'
import Goodslist from '@/views/Goodslist'
import Login from '@/views/Login'
import Register from '@/views/Register'
import Goods from '@/views/Goods'
import GoodsInfo from '@/views/GoodsInfo'
import Car from '@/views/car'
import goodsDesc from '@/views/goodsDesc'
import goodsCompent from '@/views/goodsCompent'
Vue.use(Router)

export default new Router({
  routes: [
    { path: '/',name: 'Index',component: Index },
    { path: '/news',name: 'News',component: News },
    { path: '/car',name: 'car',component: car },
    { path: '/home',name: 'Home',component: Home },
    { path: '/computer',name: 'Computer',component: Computer},
    { path: '/goodslist',name: 'Goodslist',component: Goodslist,children:[
      {path: '/goodslist/goods/:name',name:'Goods',component: Goods},
    ]},
    { path: '/login',name: 'Login',component: Login},
    { path: '/register',name: 'Register',component: Register},
    {path: '/goodsinfo/:id',name:'GoodsInfo',component: GoodsInfo},
    {path: '/car',name:'Car',component: Car},
    {path: '/goodsDesc/:id',name: 'goodsDesc',component: goodsDesc},
    {path: '/goodsCompent/:id',name: 'goodsCompent',component: goodsCompent},
  ]
})
